package com.zeny.coding.dto;


import com.zeny.coding.util.DtoUtil;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

import javax.xml.bind.ValidationException;

@Data
@NoArgsConstructor
@AllArgsConstructor
@ToString
public class CourseContentDto {
    private String id;

    private String content;

    public void isValidForUpdate() throws ValidationException {
        DtoUtil.valid(this.id, true, 1, 19);
        DtoUtil.require(this.content);
    }

    public void isValidForSave() throws ValidationException {
        DtoUtil.valid(this.id, true, 1, 19);
        DtoUtil.require(this.content);
    }
}